Thepal
|
Disciple
|
|
|
Reged: 06/21/03
|
Posts: 1359
|
Loc: Gold Coast, Australia
|
|
|
As far as I can tell, those functions just send you to '0' if you try to use a variable float value. Supposedly the expansions made them work, but they really don't seem to.
-------------------- -==Thepal==-
Creator of the Unofficial Patch. For info on that or my Ultima 9 remake or my Quest for Glory remakes go to: http://etherealsoftware.com.au/forum/index.php
Post Extras:
|
JOG
|
Curate
|
|
|
Reged: 09/15/02
|
Posts: 745
|
|
|
|
They don't work with variables. Use Setpos instead.
To teleport the player to variable exterior-locations use this:
Code:
If ( Getinterior == 1 )
coe 0,0
endif
Player->setpos x new_x
Player->setpos y new_y
Player->setpos z new_z
fixme
Player->setpos x new_x
Player->setpos y new_y
Player->setpos z new_z
If the destination is within a 3x3 cells square around the player's location (or COE target) you don't need "fixme" and the aditional "setpos"-lines.
For objects or NPCs "setpos" only works reliable within that 3x3 exterior square, or when the command is executed in the same interior cell. It might work in other cases, but only when the cell with the object/NPC is still loaded in the "Cell-Buffer"...
-------------------- Havish (Updated to v1.2 !!!)
Pirates! (WIP)
My Morrowind Corner
Edited by JOG (06/27/04 06:30 PM)
Post Extras:
|
Patrograd2
|
Curate
|
|
|
Reged: 02/02/04
|
Posts: 992
|
Loc: England
|
|
|
Quote:
As far as I can tell, those functions just send you to '0' if you try to use a variable float value. Supposedly the expansions made them work, but they really don't seem to.
Doesnt the Spriggan script place the 'sprigganup' effect using float variables?
-------------------- Patrograd's Annastian Adventures Mods
City of Thieves and DeathTrap Dungeon
http://www.geocities.com/patrograd/
Post Extras:
|
JOG
|
Curate
|
|
|
Reged: 09/15/02
|
Posts: 745
|
|
|
|
Yes, but it uses "Placeitem". Placeitem accepts variables, but it creates a new item and also only works within loaded cells (3x3 exterior-cell square or current interior cell)
-------------------- Havish (Updated to v1.2 !!!)
Pirates! (WIP)
My Morrowind Corner
Post Extras:
|
GhanBuriGhan
|
Diviner
|
|
|
Reged: 10/06/01
|
Posts: 2977
|
Loc: Behind that tree!
|
|
|
Ok, another thing to correct in MSFD!
So this was wrong?:
Quote:
Position/PositionCell can take float variables, but they must be LOCAL variables! (info by Indigo Rage)
-------------------- --//Forum Scholars guild\\--
MW Scripting for Dummies, Traveling Merchants, Combat Moves:
The Lys
World of Faces Mod
Edited by GhanBuriGhan (06/27/04 08:31 PM)
Post Extras:
|
Varana
|
Adept
|
|
|
Reged: 11/20/02
|
Posts: 288
|
Loc: Germany
|
|
|
Short highjacking of the thread: Does the FixMe command only work on the player, or also on other NPCs?
-------------------- Rigid, unbending:
Law's dominion eternal -
Order triumphant!
Post Extras:
|
JOG
|
Curate
|
|
|
Reged: 09/15/02
|
Posts: 745
|
|
|
|
Fixme only works for the Player, it causes a cell-reload, so you can work around the 3x3 cell restriction when moving the player (Without Fixme only the cell you teleport to is loaded, the cells next to it are empty (Literally, no landscape, no objects...)
-------------------- Havish (Updated to v1.2 !!!)
Pirates! (WIP)
My Morrowind Corner
Post Extras:
|
JOG
|
Curate
|
|
|
Reged: 09/15/02
|
Posts: 745
|
|
|
|
Quote:
So this was wrong?:
Quote:
Position/PositionCell can take float variables, but they must be LOCAL variables! (info by Indigo Rage)
All scripts compile, all scripts run without error, but sadly all scripts bring you to the Ashlands at 0,0 instead of Seyda Neen:
Code:
begin Testscript_global_1
float x
float y
float z
set x to -16384
set y to -81920
set z to 200
Messagebox "%.0f / %.0f / %.0f " x,y,z
player->positioncell x,y,z,0,"Balmora"
stopscript Testscript_global_1
end
Code:
begin Testscript_global_2
set Global_x to -16384
set Global_y to -81920
set Global_z to 200
Messagebox "%.0f / %.0f / %.0f " G_x,G_y,G_z
player->positioncell Global_x,Global_y,Global_z,0,"Balmora"
stopscript Testscript_global_2
end
Code:
begin Testscript_local_1
float x
float y
float z
float zr
if ( Onactivate == 1 )
set x to -16384
set y to -81920
set z to 200
Messagebox "%.0f / %.0f / %.0f " x,y,z
player->positioncell x,y,z,0,"Balmora"
Endif
end
Code:
begin Testscript_local_2
if ( Onactivate == 1 )
set Global_x to -16384
set Global_y to -81920
set Global_z to 200
Messagebox "%.0f / %.0f / %.0f " G_x,G_y,G_z
player->positioncell Global_x,Global_y,Global_z,0,"Balmora"
Endif
end
-------------------- Havish (Updated to v1.2 !!!)
Pirates! (WIP)
My Morrowind Corner
Post Extras:
|
GhanBuriGhan
|
Diviner
|
|
|
Reged: 10/06/01
|
Posts: 2977
|
Loc: Behind that tree!
|
|
|
And position has the same problem as positioncell?
-------------------- --//Forum Scholars guild\\--
MW Scripting for Dummies, Traveling Merchants, Combat Moves:
The Lys
World of Faces Mod
Post Extras:
|
JOG
|
Curate
|
|
|
Reged: 09/15/02
|
Posts: 745
|
|
|
|
Just tested the same four script with position instead of positioncell. No difference. You're still teleported to 0,0.
-------------------- Havish (Updated to v1.2 !!!)
Pirates! (WIP)
My Morrowind Corner
Post Extras:
|
Thepal
|
Disciple
|
|
|
Reged: 06/21/03
|
Posts: 1359
|
Loc: Gold Coast, Australia
|
|
|
Quote:
They don't work with variables. Use Setpos instead.
The problem with Setpos is that I can't set the player's angle (setangle doesn't turn the player. Position/PositionCell is the only way I've been able to face the player a certain way). Unless someone has a way to get setangle working on the player...
-------------------- -==Thepal==-
Creator of the Unofficial Patch. For info on that or my Ultima 9 remake or my Quest for Glory remakes go to: http://etherealsoftware.com.au/forum/index.php
Post Extras:
|
Mode_Locrian
|
Diviner
|
|
|
Reged: 10/08/02
|
Posts: 2044
|
Loc: Bjornholm, Rykith Lowlands Region
|
|
|
I'll just add that I've had no success whatsoever using variables with PositionCell. Its best to use coe/coc and setPos instead.
-------------------- My Website
Bards of Vvardenfell Thread (New Info 8/15/04)
Post Extras:
|
Thepal
|
Disciple
|
|
|
Reged: 06/21/03
|
Posts: 1359
|
Loc: Gold Coast, Australia
|
|
|
I take it noone has any ideas for setting the player's angle then
-------------------- -==Thepal==-
Creator of the Unofficial Patch. For info on that or my Ultima 9 remake or my Quest for Glory remakes go to: http://etherealsoftware.com.au/forum/index.php
Post Extras:
|
Jokester
|
Initiate
|
|
|
Reged: 06/23/04
|
Posts: 88
|
|
|
|
have you tried using Rotate or Rotate World?
EDIT: Nevermind, that only works for objects
Edited by Jokester (06/28/04 11:53 AM)
Post Extras:
|
ManaUser
|
Master
|
|
|
Reged: 06/01/00
|
Posts: 6094
|
Loc: Long Beach, CA, USA
|
|
|
The PC IS an object. And yes, those do work on the player. The only problem, is that those would actually "spin" the player, not instantly make them face the desired direction. Still, it could be done that way.
Post Extras:
|
Jokester
|
Initiate
|
|
|
Reged: 06/23/04
|
Posts: 88
|
|
|
|
well arent you able to set the rate with it? you could just set it up ridiculously high so that it gets to the right angle in 1 or 2 frames
Post Extras:
|
Thepal
|
Disciple
|
|
|
Reged: 06/21/03
|
Posts: 1359
|
Loc: Gold Coast, Australia
|
|
|
The problem is you can't take into account how much it will rotate in a frame. That is based on how much time has passed between the frames which is always changing. So you could end up facing anywhere
-------------------- -==Thepal==-
Creator of the Unofficial Patch. For info on that or my Ultima 9 remake or my Quest for Glory remakes go to: http://etherealsoftware.com.au/forum/index.php
Post Extras:
|
ManaUser
|
Master
|
|
|
Reged: 06/01/00
|
Posts: 6094
|
Loc: Long Beach, CA, USA
|
|
|
Indeed. You'd have to do a loop and keep rotating until they face the way you want. This is for chairs right? It shoudn't look too strange in that context, at least not in first person.
Post Extras:
|
Jokester
|
Initiate
|
|
|
Reged: 06/23/04
|
Posts: 88
|
|
|
|
hehe, like a dog spinning in circles before going to sleep...
but if you use a careful combination of GetAngle and rotate you should be able to get it pretty close. have it rotate for the first frame, and then have it change depending on how close you are to the desired angle...
Post Extras:
|
Thepal
|
Disciple
|
|
|
Reged: 06/21/03
|
Posts: 1359
|
Loc: Gold Coast, Australia
|
|
|
Hmm... if someone was running really slowly at the time though (which is very possible if the chair was outside since their view would be moving, lowering the frame rate) then it could take several seconds for them to face the right way.
This is probably the best way mentioned so far though.
-------------------- -==Thepal==-
Creator of the Unofficial Patch. For info on that or my Ultima 9 remake or my Quest for Glory remakes go to: http://etherealsoftware.com.au/forum/index.php
Post Extras:
|
Cortex
|
Disciple
|
|
|
Reged: 01/10/02
|
Posts: 1329
|
Loc: London, England
|
|
|
Quote:
I take it noone has any ideas for setting the player's angle then
Ive got a script that works perfectly to effectively allow me to setangle on any npc, by setting a globol variable then useing npc->startscript myscript
It works by useing the face command (which also wont take varables) and huge if statements defineing points in a huge circle 10 times the size of morrowind.
Code:
if ( zangle > 90 )
if ( zangle > 177.5 ) ; average 180
face 0 -10000000
set tempfloat to 180
elseif ( zangle > 172.5 ) ; average 175
face 871557 -9961947
set tempfloat to 175
elseif ( zangle > 167.5 ) ; avarage 170
face 1736482 -9848078
set tempfloat to 170
elseif ( zangle > 162.5 ) ; average 165
face 2588190 -9659258
set tempfloat to 165
elseif ( zangle > 157.5 ) ; average 160
face 3420201 -9396926
set tempfloat to 160
elseif ( zangle > 152.5 ) ; average 155
face 4226183 -9063078
set tempfloat to 155
elseif ( zangle > 147.5 ) ; average 150
face 5000000 -8660254
set tempfloat to 150
elseif ( zangle > 142.5 ) ; average 145
etc
-------------------- Vampire Embrace 2.1
Vampire Werewolf 1.1
Werewolf Evolution 1.0
Post Extras:
|
Rhyek
|
Initiate
|
|
|
Reged: 12/03/02
|
Posts: 76
|
Loc: Sunny Seattle (it's not all clouds and rain)
|
|
|
Quote:
Code: --------------------------------------------------------------------------------
If ( Getinterior == 1 ) coe 0,0 endif Player->setpos x new_x Player->setpos y new_y Player->setpos z new_z fixme Player->setpos x new_x Player->setpos y new_y Player->setpos z new_z
--------------------------------------------------------------------------------
Has anyone actually gotten this code (or something like it) to work in game? I always found that it'd put me at the right location but would not load the cell (even with the "fixme" and double SetPos). My understanding of the "Fixme" command was that it only moved you 128 units (for when you were trapped inside an object and cannot move out of it).
The only way I was able to get the concept to work was write a bunch-o-scripts that used COE* to every 3rd cell and then SetPos. This way it'd move you to within 1 cell of your destination and then fine tune you to the actual position. As a result, you'd be guaranteed that the cell would be loaded when you get there.
* COE does load the cells adjacent to the one you call with it.
Post Extras:
|
ManaUser
|
Master
|
|
|
Reged: 06/01/00
|
Posts: 6094
|
Loc: Long Beach, CA, USA
|
|
|
That just was I did, for the same reason. I couldn't find any better way around the not loading bug.
Post Extras:
|
Grumpy
|
Disciple
|
|
|
Reged: 08/03/02
|
Posts: 1590
|
|
|
|
I see Cortex posted the "face" function above.
Curiosity with using Position and variables on a companion (global script). It works... Sort of... A distance check on the companion reveals that they DO move with the player, but there is no processing of them. They don't appear (not rendered), nor do they function.
Subsequent move back to original cell and they are there again, but unprocessed UNTIL the player takes a step, then they just pop out of nowhere, and are active again...
Reason for the cell reload maybe (fixme)???
Might add that I used "long" variables for this and not floats, but don't ask why cause I really don't know...
-------------------- Grumpy
My mods
Post Extras:
|
Thepal
|
Disciple
|
|
|
Reged: 06/21/03
|
Posts: 1359
|
Loc: Gold Coast, Australia
|
|
|
There's a face function? And it works on the player? If so that'll solve my problem ^_^
-------------------- -==Thepal==-
Creator of the Unofficial Patch. For info on that or my Ultima 9 remake or my Quest for Glory remakes go to: http://etherealsoftware.com.au/forum/index.php
Post Extras:
|
Cortex
|
Disciple
|
|
|
Reged: 01/10/02
|
Posts: 1329
|
Loc: London, England
|
|
|
I have never tried face on the player.
Did you try the various rotate commands until the getangle is near the angle you want?
Does setangle work on the player (its virtually useless on npc's), if it does you could just use a big if statement maybe for every 5 degrees to get around it not accepting variables.
-------------------- Vampire Embrace 2.1
Vampire Werewolf 1.1
Werewolf Evolution 1.0
Post Extras:
|
Jokester
|
Initiate
|
|
|
Reged: 06/23/04
|
Posts: 88
|
|
|
|
Would the SetPos script work to send an NPC into an interior cell?
Post Extras:
|
0001
|
Initiate
|
|
|
Reged: 05/12/04
|
Posts: 51
|
|
|
|
I've gotten position cell to work for two axises using variables. The y axis and angle never seemed to work. X and Z worked fine, though.
Post Extras:
|
Jokester
|
Initiate
|
|
|
Reged: 06/23/04
|
Posts: 88
|
|
|
|
really? does it put them in the proper cell? If so, you could get the Y done with a basic setpos Y
Post Extras:
|
0001
|
Initiate
|
|
|
Reged: 05/12/04
|
Posts: 51
|
|
|
|
Yeah it puts it in the right cell, but I was looking for the angle setting more than anything.
Post Extras:
|
0001
|
Initiate
|
|
|
Reged: 05/12/04
|
Posts: 51
|
|
|
|
It sent me to 0,0 the first time I tried it, but I had mistyped the cell name.
Post Extras:
|
ManaUser
|
Master
|
|
|
Reged: 06/01/00
|
Posts: 6094
|
Loc: Long Beach, CA, USA
|
|
|
Not that I don't believe you exactly, but I've tried to do this, or very similar, and it always failed, can you post a working exmaple by any chance?
Post Extras:
|
Jokester
|
Initiate
|
|
|
Reged: 06/23/04
|
Posts: 88
|
|
|
|
well, i havent checked that yet, but I have an idea for NPCs that I think will work.
where you would have: PositionCell 123, 456, 789, 0, "Specific Cell"
You could do: Disable If ( GetPCCell "Specific Cell" == 1) SetPos X XVariable SetPos Y YVariable SetPos Z ZVariable endif
The only thing that Id need now is some way to make the name of the cell a variable, and that will probably be a bit harder...
Post Extras:
|
Jokester
|
Initiate
|
|
|
Reged: 06/23/04
|
Posts: 88
|
|
|
|
well, i havent checked that yet, but I have an idea for NPCs that I think will work.
where you would have: PositionCell 123, 456, 789, 0, "Specific Cell"
You could do: Disable If ( GetPCCell "Specific Cell" == 1) SetPos X XVariable SetPos Y YVariable SetPos Z ZVariable endif
The only thing that Id need now is some way to make the name of the cell a variable, and that will probably be a bit harder... any ideas?
Post Extras:
|
JOG
|
Curate
|
|
|
Reged: 09/15/02
|
Posts: 745
|
|
|
|
No point in checking if the player is in that cell in an NPC's local script.
The script is only executed when the player is in that cell.
Setpos works fine within the same cell or in a 3x3 exterior-cell square around the player. Only the player can be moved further than that (See the second posting of this thread )
There is no way to set a variable cell-name. For interior cells the cell-grid is global position/8192, but no way for variable interior-cell names.
for random NPC-Placement you can call the positioncell-commands according to a random number, but to place a NPC on a certain but variable position (Like teleporting to a place where the Player told the NPC to meet him if they get lost) the only way is a big-list of Positioncell-commands to place the NPC in the right 3x3 Cell-square
before using setpos when the player is near.
-------------------- Havish (Updated to v1.2 !!!)
Pirates! (WIP)
My Morrowind Corner
Post Extras:
|
Jokester
|
Initiate
|
|
|
Reged: 06/23/04
|
Posts: 88
|
|
|
|
Well the one that you posted was for a teleport to an exterior. The only reason I posted it like this is because it can teleport to anywhere regardless of whether its interior or exterior and it gets around the fact that set only works in loaded cells (rather than messing with COE...). Any idea for how to make the cell a variable?
Post Extras:
|
JOG
|
Curate
|
|
|
Reged: 09/15/02
|
Posts: 745
|
|
|
|
COE isn't the problem I'm just to lazy to write
player->Positioncell 0 0 0 0 "Foo"
The problem is SETPOS. It only works in loaded cells, no matter if the player is around, but usually you can't be sure that a cell is loaded when the player isn't within.
No way to determine the name of an interior cell. We've tried it for two years now. No way. this is why the multi-mark mod has to be so large...
-------------------- Havish (Updated to v1.2 !!!)
Pirates! (WIP)
My Morrowind Corner
Post Extras:
|
Jokester
|
Initiate
|
|
|
Reged: 06/23/04
|
Posts: 88
|
|
|
|
hmm, and I guess variables dont work with AITravel either...
Post Extras:
|
Thepal
|
Disciple
|
|
|
Reged: 06/21/03
|
Posts: 1359
|
Loc: Gold Coast, Australia
|
|
|
Quote:
No way to determine the name of an interior cell. We've tried it for two years now. No way. this is why the multi-mark mod has to be so large...
Actually, Morrowind Enhanced could probably do it. I asked them if they could do String variables a while back but couldn't remember any examples of what you'd need them for when they asked.
-------------------- -==Thepal==-
Creator of the Unofficial Patch. For info on that or my Ultima 9 remake or my Quest for Glory remakes go to: http://etherealsoftware.com.au/forum/index.php
Post Extras:
|
Jokester
|
Initiate
|
|
|
Reged: 06/23/04
|
Posts: 88
|
|
|
|
hmm, where could I find info on morrowind enhanced. my searches are just of mods made using morrowind enhanced...
Post Extras:
|
Thepal
|
Disciple
|
|
|
Reged: 06/21/03
|
Posts: 1359
|
Loc: Gold Coast, Australia
|
|
|
Follow those mods to their forums
-------------------- -==Thepal==-
Creator of the Unofficial Patch. For info on that or my Ultima 9 remake or my Quest for Glory remakes go to: http://etherealsoftware.com.au/forum/index.php
Post Extras:
|
paschors
|
Curate
|
|
|
Reged: 09/05/03
|
Posts: 955
|
Loc: Oregon, USA
|
|
|
Quote:
Quote:
No way to determine the name of an interior cell. We've tried it for two years now. No way. this is why the multi-mark mod has to be so large...
Actually, Morrowind Enhanced could probably do it. I asked them if they could do String variables a while back but couldn't remember any examples of what you'd need them for when they asked.
That is kind of funny. I can think of 20 reasons why we would want to use string variables. Multimark is only one of them. But I guess string variables isn't any use without the ability to access other portions of the data, the save file, or do LIKE commands or functions that use the string variables. Without adding a bunch of other things to the scripting language, string variables aren't that useful.
Look at the multimark code. That will show a working example of how to use variables to move a player or NCP. I believe like others have said, you must use local variables. You can store the location in a global but then must load those values into local variables in your script before using them.
-------------------- Paschors/aka Kiriel/ aka Patty
Home Page - Kiriel's Morrowind Creations
Home Page - Wheel of Time Mod
Post Extras:
|